package com.flex.business
{
	import com.adobe.cairngorm.business.Responder;
	import com.adobe.cairngorm.business.ServiceLocator;
	
	import mx.rpc.AsyncToken;
	import mx.rpc.IResponder;
	import mx.rpc.http.HTTPService;

	public class ServiceDelegate
	{

		public function ServiceDelegate( responder:Responder )
		{		
			this.responder = responder;
		}

		public function sayHello():void
		{		
			var params:Object = new Object();
			params.name = "name";
			params.age = 18;
			this.service = ServiceLocator.getInstance().getService( "helloWorldService" );
			var token : AsyncToken=service.hello(params);
			token.resultHandler = responder.onResult;
			token.faultHandler = responder.onFault;

		}


		private var responder:Responder;
		private var service : Object;
	}
}